﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AdminCmsDisplayTypeControl.ascx.cs"
    Inherits="BIS.Portal.Modules.CMS.Adm.AdminCmsDisplayTypeControl" %>
<style type="text/css">
    .waper
    {
        width: 980px;
        margin: 0 auto;
        clear: both;
    }
    .topContent
    {
        width: 570px;
        float: left;
        clear: both;
        margin: 5 5 5 5;
    }
    .topContentChilden
    {
        width: 540px;
        float: left;
        margin: 5 5 5 5;
        clear: both;
    }
    .topRight
    {
        width: 120px;
        float: left;
    }
    .topLeft
    {
        width: 400px;
        float: left;
    }
    .bottonContent
    {
        width: 960px;
        margin: 5 5 5 5;
        clear: both;
    }
</style>

<script src='<%# ModulePath + "JS/jquery-1.4.2.js" %>' type="text/javascript"></script>

<script type="text/javascript">

    function enableDelButton() {
        if ($("#<%=grvDisplayType.ClientID %> .ok :checked").length > 0) {
            $("#<%=btnDelete.ClientID %>").removeAttr("disabled");
        }
        else {
            $("#<%=btnDelete.ClientID %>").attr("disabled", "disabled");
        }
    }
    $(document).ready(function() {
        $("#<%=hdfAdminCmsDisplayType_IsPostBack.ClientID %>").val(true);
        $("#<%=grvDisplayType.ClientID %> #chkAll").click(function() {
            var $this = $(this);
            if ($this.attr("checked") == true) {
                $(".chkSell :checkbox").attr("checked", "checked");
                enableDelButton();
            }
            else {
                $(".chkSell :checkbox").removeAttr("checked");
            }
        });

        $("#<%=grvDisplayType.ClientID %> .ok :checkbox").bind("click", function() {
            enableDelButton();
        });
    });
	
</script>

<div class="waper">
    <div class="topContent">
        <div class="topContentChilden">
            <b>QUẢN LÝ THÔNG TIN TOP HIỂN THỊ ĐẶC BIỆT</b>
        </div>
        <div class="topContentChilden">
            <div class="topRight">
                Tên top hiển thị</div>
            <div class="topLeft">
                <asp:TextBox ID="txtDisplayTypeName" runat="server" Width="350px" Height="25px"></asp:TextBox></div>
        </div>
        <div class="topContentChilden">
            <div class="topRight">
                Trạng Thái</div>
            <div class="topLeft">
                <asp:DropDownList runat="server" ID="ddlStatus" Width="200px" Height="25px">
                    <asp:ListItem Value="0">Tạm ẩn</asp:ListItem>
                    <asp:ListItem Value="1">Cho phép hiển thị</asp:ListItem>
                    <asp:ListItem Value="99">Xóa logic</asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>
        <div style="text-align: center" class="topContentChilden">
            <asp:Button runat="server" ID="btnAddNew" Text="Thêm mới" Width="90px" Height="25px"
                OnClick="btnAddNew_Click" />
            &nbsp;<asp:Button runat="server" ID="btnUpdate" Text="Cập nhật" Width="90px" Height="25px"
                Enabled="false" OnClick="btnUpdate_Click" />
            &nbsp;<asp:Button runat="server" ID="btnCancel" Text="Bỏ Qua" Width="90px" Height="25px"
                Enabled="false" OnClick="btnCancel_Click" />
        </div>
        <div style="color: #FF0000; float: left; clear: both; margin-top: 5px; margin-left: 5px;">
            <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
        </div>
    </div>
    <div style="height: 22px; float: left; clear: both; width: 140px;">
        <asp:Button ID="btnDelete" runat="server" Text="Xóa" Width="140px" OnClick="btnDelete_Click"
            Enabled="false" />
    </div>
    <div class="bottonContent">
        <asp:GridView ID="grvDisplayType" CssClass="chkSell" runat="server" AllowSorting="True"
            AutoGenerateColumns="False" Width="954px" HeaderStyle-BackColor="AliceBlue" HeaderStyle-Font-Bold="true"
            HeaderStyle-Font-Size="16px" HeaderStyle-Height="30px" CellPadding="1" OnRowEditing="grvDisplayType_RowEditing"
            OnPageIndexChanging="grvDisplayType_PageIndexChanging" OnRowDataBound="grvDisplayType_RowDataBound">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="chkAll" type="checkbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSell" runat="server" CssClass="ok" />
                    </ItemTemplate>
                    <HeaderStyle Width="5px" HorizontalAlign="Center"></HeaderStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên top hiển thị">
                    <ItemTemplate>
                        <asp:Label ID="lblDisplayTopName" runat="server" Text='<%#Eval("Display_type_name") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Số lượng tin">
                    <ItemTemplate>
                        <asp:Literal ID="ltrArticleCount" runat="server" Text='<%#Eval("Number_of_article") %>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Trạng thái">
                    <ItemTemplate>
                        <asp:Literal ID="ltrStatus" runat="server"></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Người cập nhật cuối">
                    <ItemTemplate>
                        <asp:Literal ID="ltrLastUpdateBy" runat="server" Text='<%#Eval("Last_update_by") %>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ngày cập nhật cuối">
                    <ItemTemplate>
                        <asp:Literal ID="ltrLastDate" runat="server" Text='<%#Eval("Last_update") %>'></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="edit" Text="Sửa"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtnManager" runat="server" Text="Quản lý danh sách nội dung"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle BackColor="AliceBlue" Font-Bold="True" Font-Size="16px" Height="30px">
            </HeaderStyle>
            <EmptyDataTemplate>
                No results!
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
    <asp:HiddenField ID="hdfAdminCmsDisplayType_IsPostBack" runat="server" Value="false" />
</div>
